var app = getApp();
Page({
  data: {
    item: [],
    sum: 0,
    Listsum: 0,
    touchEnd: 0,
    touchStart: 0,
    hidden:true
  },

  touchStart: function (e) {
    var that = this;
    that.setData({
      touchStart: e.timeStamp
    })
  },

  touchEnd: function (e) {
    var that = this;
    that.setData({
      touchEnd: e.timeStamp
    })
  },

  pressTap: function (e) {
    var postid = e.currentTarget.dataset.postid
    var that = this;
    var touchTime = that.data.touchStart - that.data.touchEnd;
    if (touchTime >= 600) { //自定义长按时长，单位为ms
      this.setData({
        hidden:false
      })

    }
    if (touchTime < 600) {
      that.setData({
        touchEnd: 0,
        touchStart: 0
      })
    }
  },

  onLoad: function (options) {
    wx.setNavigationBarTitle({
      title: '会员名单',
      
    })
    let tableName = 'member'

    // 应用查询对象
    let Product = new wx.BaaS.TableObject(tableName)

    // 不设置查询条件
    Product.find().then(res => {
      // success
      console.log(res)
      this.setData({
        item: res.data.objects,
        sum:res.data.objects.length
      })
    }, err => {
      // err
    })
  },

  OnIsSendTap: function (event) {
    wx.redirectTo({
      url: '/pages/pass_2/pass_2',
    })
  }
})